/**
 * @summary 文章请求模块
 */

import req from '@/utils/request';
import * as URL from '@/constants/api';
export function getSearchList(searchValue) {
  return req({
    url: URL.SEARCH_LIST,
    params: {
      q: searchValue
    }
  })
    .then(res=> res.data.data.options.filter(o=> o?.trim()))
    .catch(()=>[])
}

export function getSearchResult(searchValue) {
  return req({
    url: URL.RESULT_LIST,
    params: {
      q: searchValue
    }
  })
    .then(res=> res.data.data.results)
    .catch(()=>[])
}
